// ActionScript file
package com.app.commands{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.app.business.MahasiswaDelegate;
	import com.app.control.GetListDosenEvent;
	import com.app.model.ModelLocator;
	import com.app.vo.MahasiswaVO;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;
	

	public class GetListDosenCommand implements ICommand,IResponder{
		
        private var model:ModelLocator=ModelLocator.getInstance();
        
        public function execute(event:CairngormEvent):void{
           model.mahasiswa.isPending=true;
           var delegate:MahasiswaDelegate=new MahasiswaDelegate(this);
           var getListDosenEvent:GetListDosenEvent= GetListDosenEvent(event);
           delegate.getListDosen(getListDosenEvent.mahasiswaVo);
        }
        
        public function result(data:Object):void{
            model.mahasiswa.isPending=true;
            model.mahasiswa.mahasiswaVo=MahasiswaVO(data);
        }
        
        public function fault(info:Object):void{
            Alert.show( "Get Info Dosen Failed","Alert");
            model.mahasiswa.isPending = false;
        }
	}
}